const range = (start, stop, step) => Array.from({ length: (stop - start) / step + 1 }, (_, i) => start + i * step);

// 生成数字范围
console.log(range(0, 4, 1));
// [0, 1, 2, 3, 4]

// 生成字母表
console.log(range("A".charCodeAt(0), "Z".charCodeAt(0), 1).map((x) => String.fromCharCode(x)));
// ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']